public class Student {
    private final String name;
    private final int numPreferred;
    private final PaperType preferredType;

    public Student(String name, int numPreferred, PaperType preferredType) {
        this.name = name;
        this.numPreferred = Math.max(1, Math.min(4, numPreferred)); // 限制在 1~4 篇
        this.preferredType = preferredType;
    }

    public String getName() {
        return name;
    }

    public int getNumPreferred() {
        return numPreferred;
    }

    public PaperType getPreferredType() {
        return preferredType;
    }

    public String toString() {
        return name + " (wants " + numPreferred + " papers of type " + preferredType + ")";
    }
}
